# $Id: PKGBUILD 178221 2013-02-18 14:05:53Z jgc $ 
# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgbase=libgnome
pkgname=('libgnome' 'libgnome-data')
pkgver=2.32.1
pkgrel=4
arch=('i686' 'x86_64')
license=('LGPL')
makedepends=('intltool' 'gnome-vfs' 'libbonobo' 'gconf' 'gvfs' 'libcanberra')
options=('!libtool' '!emptydirs')
url="http://www.gnome.org"
source=(http://ftp.gnome.org/pub/gnome/sources/${pkgbase}/2.32/${pkgbase}-${pkgver}.tar.bz2)
sha256sums=('b2c63916866485793b87398266dd7778548c1734923c272a94d84ee011b6f7a4')

build() {
  cd "${srcdir}/${pkgbase}-${pkgver}"

  ./configure --prefix=/usr --sysconfdir=/etc \
      --localstatedir=/var --disable-static --disable-esd
  make
}

package_libgnome() {
    pkgdesc="Common libraries for GNOME"
    depends=("libgnome-data=${pkgver}" 'gnome-vfs' 'libbonobo' 'gconf' 'gvfs' 'libcanberra')

    cd "${srcdir}/${pkgbase}-${pkgver}"

    make -C libgnome DESTDIR="${pkgdir}" install
    make -C monikers DESTDIR="${pkgdir}" install
}

package_libgnome-data() {
   pkgdesc="Common data from libgnome"
   depends=('gconf')
   install=libgnome.install

   cd "${srcdir}/${pkgbase}-${pkgver}"

   for dir in doc gnome-data po schemas
   do
       make -C $dir GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 DESTDIR="${pkgdir}" install
   done

   install -m755 -d "${pkgdir}/usr/share/gconf/schemas"
   gconf-merge-schema "${pkgdir}/usr/share/gconf/schemas/${pkgbase}.schemas" --domain libgnome-2.0 ${pkgdir}/etc/gconf/schemas/*.schemas
   rm -f ${pkgdir}/etc/gconf/schemas/*.schemas
}
